package com.luo.simple.util;

import org.springframework.stereotype.Component;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Component
public class PhoneUtil {
    //验证手机号正则表达式字符串
    private static String regex = "^[1]\\d{10}$";

    public boolean compilePhoneRegex(String phone) {
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(phone);
        return m.matches();
    }
}
